import React, { Component } from 'react'
import { Route, Switch, Redirect } from 'react-router-dom'
import MyNavLink from '../../component/MyNavLink'
import New from './New'
import Message from './Message'

export default class Home extends Component {
  render() {
    return (
      <div>
        <h2>Home组件</h2>
        <div>
          <div>
             <MyNavLink to="/home/new">New</MyNavLink>
             <MyNavLink to="/home/message">Message</MyNavLink>
          </div>
          <div>
          <Switch>
               <Route path='/home/new' component={New} />
               <Route path='/home/message' component={Message} />
               <Redirect to='/home/new'></Redirect>
            </Switch>
          </div>
        </div>
      </div>
    )
  }
}
